package rpg002;

import java.awt.Color;
import java.awt.Graphics;

/**
 *
 * @author Smai
 */
public class UserInterface {

  private ActionListener actionListener;
  private Player player;

  private float playerHealth;
  private float playerMana;

  public UserInterface(Player player, ActionListener actionListener) {
    this.actionListener = actionListener;
    this.player = player;
  }

  public void paint(Graphics gbi) {
    playerHealth = 128 / (float)player.maxHealth * player.health;
    playerMana = 128 / (float)player.maxMana * player.mana;
    gbi.setColor(Color.black);
    gbi.drawRect(15, 15, 129, 9);
    gbi.drawRect(15, 27, 129, 9);
    gbi.setColor(Color.red);
    gbi.fillRect(16, 16, (int)playerHealth, 8);
    gbi.setColor(Color.blue);
    gbi.fillRect(16, 28, (int)playerMana, 8);
  }
}

// / player.maxHealth * player.health